<?php

namespace app\api\model;

use think\Model;

class Convert extends Model
{
    protected $name = 'meeting_convert';
    //校验规则
    protected $rules = [
    ];

    /**
	 * [createData 新建]
	 * @linchuangbin
	 * @DateTime  2017-02-10T21:19:06+0800
	 * @param     array                    $param [description] lid-实时转写外键 transfer-转写结果 url-音频地址 pcmtime-长度 sorting-顺序
	 * @return    [array]                         [description]
	 */
	public function createData($param)
	{
		// 验证  先不写规则待定
		$validate = validate($this->rules);
		if (!$validate->check($param)) {
			$this->error = $validate->getError();
			return false;
		}
		try {
			$this->data($param)->allowField(true)->save();
			return true;
		} catch(\Exception $e) {
			//$this->error = '添加失败';
			return false;
		}
	}


}